package com.monitor.core.handler;

import com.alibaba.fastjson.JSON;
import com.monitor.core.bean.MonitorMessage;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

/**
 * @Auther: hanhui.liu
 * @Date: 2018/4/24 15:19
 * @Description:
 */
@Component
public class DefaultMessageHandler extends MessageHandler {
    private static final Logger logger = Logger.getLogger(DefaultMessageHandler.class);

//    private static DefaultMessageHandler instance;

//    public static DefaultMessageHandler getInstance() {
//        if (instance == null) {
//            synchronized (DefaultMessageHandler.class) {
//                instance = new DefaultMessageHandler();
//            }
//        }
//        return instance;
//
//    }

    @Override
    public void send(MonitorMessage monitorMessage) {
        logger.info("DefaultMessageHandler send start");
        logger.info(JSON.toJSONString(monitorMessage));
        logger.info("DefaultMessageHandler send end");
    }
}
